package com.suming.springboot_game.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Object data;
    private String code;
    private String message;

    public static Result success(){
        return new Result(null,Constants.CODE_200,"");
    }

    public static Result success(Object data){
        return new Result(data,Constants.CODE_200,"");
    }

    public static Result error(String code,String message){
        return new Result(null,code,message);
    }

    public static Result error(){
        return new Result(null,Constants.CODE_500,"系统错误");
    }
}
